<script>
    //静态字段定义在函数对象上，使用类名加字段名访问，共享
    class Shape{
        static width=100;  //静态字段
    }
    var s1=new Shape();
    console.log(s1.width);  //undefined

    console.log(Shape.width);

    function Shape2(){
    }
    Shape2.width=100;
    console.log(Shape2.width);

</script>